//
//  BAResourceCell.m
//  BabyAlbum
//
//  Created by master on 17/3/1.
//  Copyright © 2017年 master. All rights reserved.
//

#import "BAResourceCell.h"

@interface BAResourceCell ()
@property (weak, nonatomic) IBOutlet UIImageView *imageView;
@property (weak, nonatomic) IBOutlet UIButton *deleteButton;

@end

@implementation BAResourceCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setImage:(UIImage *)image editMode:(BOOL)editMode {
    self.deleteButton.hidden = !editMode;
    self.imageView.image = [image thumbImageForSize:CGSizeMake(200, 200)];
}


- (IBAction)delete:(id)sender {
    if(self.deleteBlock) {
        self.deleteBlock();
    }
}

- (void)setImage:(UIImage *)image {
    _image = image;
    self.imageView.image = _image;
}

@end
